package com.beyondsoft.dtc.mobile.automation.base;

/**
 * Created by Robin on 3/11/2016.
 */
public class BaseException extends Exception {
	public final static int OK = 0;
	public final static int ERROR_ANDROID_HOME_NOT_FOUND = 1;
	public final static int ERROR_CAMMAND_NOT_FOUND = 2;
	public final static int ERROR_CAMMAND_FAILD = 3;
	public final static int ERROR_DOWNLOAD_FAILD = 4;
	public final static int ERROR_PARSE_APK_FAILD = 5;
	public final static int ERROR_DEVICE_OFFLINE = 6;

	private int errorCode;
	private String errorMsg;

	public BaseException(int errorCode) {
		this.errorCode = errorCode;
	}

	public BaseException(int errorCode, String errorMsg) {
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}

	public int getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	@Override
	public String getMessage() {
		return this.errorMsg + "; errorCode: " + this.errorCode;
	}
}
